<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="vue.js"></script>
    <title>Document</title>
</head>

<body>
    <main id="app">
        <input v-model="initial" type="text">
        <br>
        <label for="">大写:</label>
        <input v-model="upper" type="text">
        <br>
        <label for="">小写:</label>
        <input v-model="lower" type="text">
    </main>
    <script>
        var vue = new Vue({
            el: '#app',
            data: {
                initial: '',
                upper: '',
                lower: ''
            },
            watch: {
                initial: function () {
                    this.upper = this.initial.toUpperCase();
                    this.lower = this.initial.toLowerCase();
                }
            },
        })
    </script>
</body>

</html>